<!DOCTYPE html>
<html lang="en">
<head>
    <title>健康卡注册</title>
    <titleType style="display: none">healthCard_register</titleType>
    <%- include('../../_global/baseLibs') %>
        <link rel="stylesheet" href="/quickJs/scripts/mui/css/mui.min.css">
    <link rel="stylesheet" href="/quickJs/scripts/mui/mui.picker.min.css">
    <script type="text/javascript" src="/quickJs/scripts/mui/js/mui.min.js"></script>
    <script type="text/javascript" src="/quickJs/scripts/mui/mui.picker.min.js"></script>
    <script type="text/javascript" src="/static/lib/plupload/plupload.full.min.js"></script>
    <!--<script type="text/javascript" src="/static/lib/url.js"></script>-->
    <script type="text/javascript" src="/static/lib/util.js"></script>
    <script type="text/javascript" src="/static/js/jkk.js"></script>
</head>
<body>
<section class="page-wrap page-family">
    <!-- header start -->
    <header id="header" class="header-box grey fixed"  >
        <div class="header-content">
            <div class="left-tool">
                <a class="back"><i class="iconfont icon-back"></i></a>
            </div>
            <div class="title">健康卡注册</div>
        </div>
    </header>
    <!-- header end -->
    <!--content start-->
   <section class="content">
        <aside class="plane-box first family-plane">
            <ul class="default-list form-list">
                <li>
                    <div class="item-inner">
                        <div class="item-title">
                            姓名
                        </div>
                        <div class="item-center">
                            <input class="input-text" id="name" type="text" placeholder="请输入真实姓名(必填)" value="">
                             <i class="iconfont icon-more"></i>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-inner">
                        <div class="item-title">
                            证件类型
                        </div>
                        <div class="item-center">
                            <input id="IDType" class="input-text" type="text" placeholder="必填" value="">
                            <i class="iconfont icon-more"></i>
                        </div>
                    </div>
                </li>
                <li >
                    <div class="item-inner">
                        <div class="item-title">
                            证件号码
                        </div>
                        <div class="item-center">
                            <input id="cardValue" class="input-text" type="text" placeholder="请输入真实的证件号(必填)" value="">
                            <i class="iconfont icon-more"></i>
                        </div>
                    </div>
                </li>
                 <li>
                    <div class="item-inner">
                        <div class="item-title">
                            居民唯一ID号
                        </div>
                        <div class="item-center">
                             <input class="input-text" id="cardId" type="text" placeholder="必填" value="">
                            <i class="iconfont icon-more"></i>
                        </div>
                    </div>
                </li>
                  <li>
                    <div class="item-inner">
                        <div class="item-title">
                            认证模式
                        </div>
                        <div class="item-center">
                            <input class="input-text" type="text" placeholder="必填" value="" id='identifyType'>
                            <i class="iconfont icon-more"></i>
                        </div>
                    </div>
                </li>
            </ul>
        </aside>

        <aside class="plane-box">
            <ul class="default-list form-list">
             <li>
                    <div class="item-inner">
                        <div class="item-title">
                            性别
                        </div>
                          <div class="item-center">
                            <input class="input-text blurInput" id="gerderYype" type="text" placeholder="选填" value="">
                             <i class="iconfont icon-more"></i>

                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-inner">
                        <div class="item-title">
                            出生日期
                        </div>
                        <div class="item-center">
                             <input class="input-text blurInput"  id="birth" type="text" placeholder="选填" value="" readonly>
                              <i class="iconfont icon-more"></i>
                        </div>
                    </div>
                </li>
               <li>
                    <div class="item-inner">
                        <div class="item-title">
                            联系电话
                        </div>
                        <div class="item-center">
                            <input class="input-text" id="phoneNum" type="text" placeholder="请输入手机号码(选填)" value="">
                             <i class="iconfont icon-more"></i>
                        </div>
                    </div>
                </li>
                 <li>
                    <div class="item-inner">
                        <div class="item-title">
                            文化程度
                        </div>
                        <div class="item-center">
                            <input class="input-text" id="Educational" type="text" placeholder="选填" value="" readonly>
                             <i class="iconfont icon-more"></i>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-inner">
                        <div class="item-title">
                            职业
                        </div>
                        <div class="item-center">
                            <input class="input-text" id="Occupation" type="text" placeholder="选填" value="" readonly>
                             <i class="iconfont icon-more"></i>
                        </div>
                    </div>
                </li>
             <li>
                    <div class="item-inner">
                        <div class="item-title">
                            民族
                        </div>
                        <div class="item-center">
                            <input class="input-text" id="Nation" type="text" placeholder="选填" value="" readonly>
                             <i class="iconfont icon-more"></i>
                        </div>
                    </div>
                </li>
            <!-- <li>
                    <div class="item-inner">
                        <div class="item-title">
                            国籍
                        </div>
                        <div class="item-center">
                             <input class="input-text" id="phoneNum" type="text" placeholder="选填" value="" readonly>
                              <i class="iconfont icon-more"></i>
                        </div>
                    </div>
                </li> -->
             <li>
                    <div class="item-inner">
                        <div class="item-title">
                            婚姻状况
                        </div>
                        <div class="item-center">
                             <input class="input-text" id="maritaLStatus" type="text" placeholder="选填" value="" readonly>
                            <i class="iconfont icon-more"></i>
                        </div>
                    </div>
                </li>
                
                
        </aside>

        <aside  class="plane-box">
            <ul class="default-list form-list">
                <li>
                    <div class="item-inner">
                        <div class="item-title">
                            新农合(卡)号
                        </div>
                        <div class="item-center">
                            <input class="input-text" id="age" type="number" placeholder="选填" value="" readonly>
                             <i class="iconfont icon-more"></i>
                            <!-- <i class="iconfont icon-more"></i> -->
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-inner">
                        <div class="item-title">
                        健康档案号
                        </div>
                        <div class="item-center">
                            <input id="gender" class="input-text" type="text" placeholder="选填" value="">
                            <i class="iconfont icon-more"></i>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-inner">
                        <div class="item-title">
                            居住地址
                        </div>
                        <div class="item-center">
                            <input class="input-text" id="height" type="number" placeholder="选填" value="">
                            <i class="iconfont icon-more"></i>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-inner">
                        <div class="item-title">
                            户籍地址
                        </div>
                        <div class="item-center">
                            <input class="input-text" id="weight" type="number" placeholder="选填" value="">
                            <i class="iconfont icon-more"></i>
                        </div>
                    </div>
                </li>
                  <li>
                    <div class="item-inner">
                        <div class="item-title">
                           认证资料
                        </div>
                        <div class="item-center">
                            <input class="input-text" id="address" type="text" placeholder="选填" value="">
                            <i class="iconfont icon-more"></i>
                        </div>
                    </div>
                </li>
            </ul>
        </aside>


     <aside class="button-box">
            <div  class="button button-primary" id="zhuche">注册</div>
        </aside>
    </section>

</section>

<script>



    var page_register = (function($, page_register) {
        function pickerChange(id,data){
            // 初始化数据
            var picker = new mui.PopPicker();
            picker.setData(data);
            /*弹出选择器 并传递关闭回调函数*/
            picker.show(function (selectItems) {
                $(id)[0].value=selectItems[0];
            });
        }
        function changeTime(id){
            document.getElementById(id).blur();
            var myDate = new Date();
            var nowYear=myDate.getFullYear();
            var options = JSON.parse('{"type":"date","beginYear":1900,"endYear":2018}');
            var picker = new mui.DtPicker(options);
            picker.show(function (selectItems) {
                $('#'+id).val(selectItems.y.text+'-'+selectItems.m.text+'-'+selectItems.d.text)
            })
        }
        function register(){
            if(getInputValue('name').trim()==""){
                layer.open({
                    content: '姓名不能为空'
                    ,btn: '我知道了'
                });
                return false;
            }
            if(getInputValue("IDType").trim()==""){
                layer.open({
                    content: '证件类型不能为空'
                    ,btn: '我知道了'
                });
                return false;
            }
            if(getInputValue('cardValue').trim()==""){
                layer.open({
                    content: '证件号码不能为空'
                    ,btn: '我知道了'
                });
                return false;
            }
            if(getInputValue('cardId').trim()==""){
                layer.open({
                    content: '居民唯一Id不能为空'
                    ,btn: '我知道了'
                });
                return false;
            }
            if(getInputValue("identifyType").trim()==""){
                layer.open({
                    content: '认证模式不能为空'
                    ,btn: '我知道了'
                });
                return false;
            }

            var obj ={
                request:{
                    aac003:getInputValue('name'),//姓名
                    zjlb:getId(getInputValue("IDType"),IDType),
                    zjhm:getInputValue('cardValue'),
                    residentID:getInputValue('cardId'),
                    rzfs:getId(getInputValue("identifyType"),identifyType),
                    aac004:getInputValue('gerderYype'),
                    aac006:"",
                    aac005:"",
                    nationality:"",
                    aac017:"",
                    xlhh:"",
                    Jkdah:"",
                    lxdh:"",
                    aac011:"",
                    zydm:"",
                    dz:"",
                    addr:"",
                    file1:"",
                    aan001:"",
                }

            }

            $.QuickUrlUtils.redirectJSBridge({
                url: "/html/gzd/jkk/list.html",
                title: "我的健康卡",
                type: "forget"
            });
        }

        var cfg_def = {
            pickerChange: pickerChange,
            changeTime: changeTime,
            register: register,
        }

        page_register.init = function(cfg){
            $.extend(page_register, cfg_def, cfg);
            $("#gerderYype").click(function(){
                page_register.pickerChange("#gerderYype", getValues(gerderYype));
            });

            $("#IDType").click(function(){
                page_register.pickerChange("#IDType", getValues(IDType));
            });
            $("#identifyType").click(function(){
                page_register.pickerChange("#identifyType", getValues(identifyType));
            });
            $("#Educational").click(function(){
                page_register.pickerChange("#Educational", getValues(Educational));
            });
            $("#Occupation").click(function(){
                page_register.pickerChange("#Occupation", getValues(Occupation));
            });
            $("#Nation").click(function(){
                page_register.pickerChange("#Nation", getValues(Nation,'nation'));
            });
            $("#maritaLStatus").click(function(){
                page_register.pickerChange("#maritaLStatus",getValues(maritaLStatus));
            });
            $('#birth').click(function () {
                page_register.changeTime('birth')
            })
            $('#zhuche').click(page_register.register)
        }

        return page_register;
    })(jQuery, {});
    
</script>

</body>
</html>